import {COMMISSIONLIST, COMMISSIONUPDATE, COMMISSIONDELETE} from '@/services/api'
import {request, METHOD} from '@/utils/request'

/**
 * 获取佣金列表
 * @param name
 * @param password
 * @returns {Promise<*>}
 */
export async function getCommissionList(pageIndex, pageSize, params) {
    params.pageIndex = pageIndex
    params.pageSize = pageSize
    return request(COMMISSIONLIST, METHOD.POST, params)
}

/**
 * 保存佣金信息
 * @param params
 * @returns {Promise<*>}
 */
export async function updateCommission(params) {
    return request(COMMISSIONUPDATE, METHOD.POST, params)
}

/**
 * 删除佣金信息
 * @param params
 * @returns {Promise<*>}
 */
export async function deleteCommission(id) {
    return request(COMMISSIONDELETE, METHOD.GET, {Id: id})
}